package org.flh.book.shop.common.response;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 描述：返回数据集（带数据总数）
 *
 * @author 花好月圆
 * @date 2021/1/18 13:23
 */
@Data
@ApiModel
@NoArgsConstructor
public class DataTotalView<T> {

    @ApiModelProperty("结果集")
    private List<T> data;

    @ApiModelProperty(value = "总数", example = "0")
    private Integer total;

    public DataTotalView(List<T> list, int total) {
        this.data = list;
        this.total = total;
    }
}
